import { createRouter, createWebHashHistory } from 'vue-router'


const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/mycare' //redirect 重定向 默认跳转我的关注页
    },
    {
      path: '/mycare',
      component: () => import('../views/Mycare.vue'),
      meta: { title: '关注/粉丝' }
    },
  ],
})
// 路由后置拦截器
router.afterEach((to) => {
  document.title = to.meta.title as string || '极客园'
})

export default router
